<?php 
session_start();
include("db_connect.php");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Basciautosales store the place where you can buy trade set build your own dream cars at its your ways" />
<meta name="description" content="Basciautosales store the place where you can buy trade set build your own dream cars at its your ways" />

<?php include("include/jquery.php");?>

<script>
$(document).ready(function() {

var name = $("#author");
var email = $("#email");
var subject = $("#subject");
var content = $("#text");

$("#submit").click(function () {

	if(name.val() == "" || name.val() == " " ){
		alert("Please input your name");
		name.focus();
		return false;
	}
	else if(email.val() == "" || email.val() == " " ){
		alert("Please input your email");
		email.focus();
		return false;
	}
	else if(!isValidEmail(email.val())){
		alert("Please input a proper email");
		email.focus();
		return false;
	}
	else if(subject.val() == "" || subject.val() == " " ){
		alert("Please input your subject");
		subject.focus();
		return false;
	}
	else if(content.val() == "" || content.val() == " " ){
		alert("Please input your message");
		content.focus();
		return false;
	}
	else{
		
		$.ajax({
			url:'scripts/sendemail.php?name='+name.val()+"&email="+email.val()+"&subject="+subject.val()+"&content="+content.val(),
			success:function (data){
				
				if(data == 'sent'){
					alert("Our management will verify your message");
					location.reload();
				}
				else{
					alert("Something went wrong Please try again.");
				}
				
			}
		});
		
		
	}
	
	
});

function clear(){
name.val()= "";
email.val()= "";
subject.val()= "";
content.val()= "";
return false();
}
function isValidEmail(strEmail){
var validRegExp;
validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1){
		return false;
    } 
    return true; 
}	

});

</script>
</head>
<body> <div id=" msgbox"></div>

<div id="templatemo_wrapper">
	<!--header-->
		<?php include("include/header.php");?>
	<!--header-->
    
    <div id="templatemo_main">
   		<!--sidebar-->
		<div id="sidebar" class="float_l">
			<!--top-->
			<img src="images/news.png" />
			<div class="sidebar_box">
				   
                <div class="content"> 
                	<img src="images/facebook.png" />&nbsp; &nbsp; &nbsp; <a id="facebook "href="https://www.facebook.com/pages/Basci-Autosales/155885811108484?fref=ts" style="position: absolute;"><b>Visit us on Facebook</b></a>
					
				<br /><br />
				
				</div>
			</div>
        	<!--endtop-->
			
			<!--bottom-->
			<img src="images/online-shop.png" />
			<div class="sidebar_box">
				  
                <div class="content"> 
                	<p style="color:#6d7172;">Our shop offers you the opportunity to<br/> 
					high-quality products for<br/>
					purchase Basci Automobiles exclusively.</p>
					
					<a href="shop.php"><img src="images/shop-icon.png" /></a><br /><br />
				</div>
			</div>
        	<!--endbottom-->
			
	</div><!--siderbar-->
		
		
        <div id="content" class="float_r">
        	
            <h1>Contact Information</h1>
            <div class="content_half float_l">
				<h4>Send us a message now!</h4>
                <p>Etiam id massa scelerisque nunc luctus ultrices tellus laoreet eget a sem. Validate <a href="http://validator.w3.org/check?uri=referer" rel="nofollow"><strong>XHTML</strong></a> &amp; <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="nofollow"><strong>CSS</strong></a>.</p>
                <div id="contact_form">
                 <div class="form">
                        
                        <label for="author">Name:</label> <input type="text" id="author" name="author" class="required input_field" />
                        <div class="cleaner h10"></div>
                        <label for="email">Email:</label> <input type="text" id="email" name="email" class="validate-email required input_field" />
                        <div class="cleaner h10"></div>
                        
						<label for="subject">Subject:</label> <input type="text" name="subject" id="subject" class="input_field" />

						<div class="cleaner h10"></div>
        
                        <label for="text">Message:</label> <textarea style="width: 329px; height: 157px;" id="text" name="text" rows="0" cols="0" class="required"></textarea>
                        <div class="cleaner h10"></div>
                        
                        <input type="submit" value="Send" id="submit" name="submit" class="submit_btn float_l" />
						<input type="reset" value="Reset" id="reset" name="reset" onclick="clear();" class="submit_btn float_r" />
                        
            	</div>
                </div>
            </div>
        <div class="content_half float_r">
        	<h4>Mailing Address</h4>
        	<h6><strong>Location One</strong></h6>
          132-145 Aliquam vitae mi tellus,<br />
            	Nulla mauris elit pretium, 23900<br />
            	Pellentesque sit amet<br /><br />
            
				<strong>Phone:</strong> 090-090-1080<br />
            	<strong>Email:</strong> <a href="mailto:info@yoursite.com">info@yoursite.com</a><br />
                
            <div class="cleaner h20"></div>
            <h6><strong>Location Two</strong></h6>
          211-303 Curabitur tincidunt euismod,<br />
            	Sed eu  tortor nunc at ipsum, 14080<br />
            	Vestibulum nec tincidunt<br /><br />
            
				<strong>Phone:</strong> 020-050-1920<br />
            	<strong>Email:</strong> <a href="mailto:info@yoursite.com">info@yoursite.com</a><br />
        </div>
        
        <div class="cleaner h40"></div>
        
            
        </div> 
        <div class="cleaner"></div>
    </div> <!-- END of templatemo_main -->
    
    <!--footer-->
	<?php include("include/footer.php");?>
    
</div> <!-- END of templatemo_wrapper -->

</body>
</html>